#ifndef LRESPROCESSOR_H_
#define LRESPROCESSOR_H_

#include <MTXml/MTXml.h>
#include <MAUtil/String.h>
#include "DTO.h"

using namespace MAUtil;
using namespace Mtx;

class LRESProcessor : public XmlListener
{
  public:
    LRESProcessor();
    ~LRESProcessor();

    //XmlListener
    void mtxEncoding(const char* value);
    void mtxTagStart(const char* name, int len);
    void mtxTagAttr(const char* attrName, const char* attrValue);
    void mtxTagStartEnd();
    void mtxTagData(const char* data, int len);
    void mtxTagEnd(const char* name, int len);
    void mtxParseError();
    void mtxEmptyTagEnd();
    unsigned char mtxUnicodeCharacter(int unicode);

    //Property setters
    void setLRESListener(LRESListener* listener);
    void addRequest(String& url, LRESListener* requester);
  private:
    enum LRES_Tags
    {
    	LRES_NULL,
    	LRES_ID,
    	LRES_NAME,
    	LRES_DRAWDATE,
    	LRES_ISTODAY,
    	LRES_SMSCNT,
    	LRES_SHORTCODE,
    	LRES_RESULT,
    	LRES_OUTOFDATE
    } mLRESTag;

    LRESListener* mListener;
    LRESItem mCurrentItem;
    String temp;
    String mFirstTag;
    bool mInBody;
    bool mInItem;
};

#endif /* LRESPROCESSOR_H_ */
